#include <stdio.h>

int gcd_loop(int a, int b) {
    while(b != 0) {
        int new_b = a % b;
        a = b;
        b = new_b;
    }
    return a;
}

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}

int main(void) {
    while (1) {
        int a, b;
        scanf("%d%d", &a, &b);
        if (a == 0 && b == 0) {
            break;
        }
        printf("%d\n", a * b / (a > b ? gcd_loop(a, b) : gcd_loop(b, a)));
    }
    return 0;
}
